package com.bwie.system.service.impl;

import com.bwie.common.domain.Goods;
import com.bwie.system.mapper.GoodsMapper;
import com.bwie.system.service.GoodsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    GoodsMapper goodsMapper;
    @Override
    public PageInfo<Goods> goodslist(Goods goods) {
        PageHelper.startPage(goods.getPageNum(),goods.getPageSice());
     List<Goods> goodsList= goodsMapper.goodslist(goods);
        PageInfo<Goods> goodsPageInfo = new PageInfo<>(goodsList);
        return goodsPageInfo;
    }

    @Override
    public PageInfo<Goods> goodslists(Goods goods) {
        PageHelper.startPage(goods.getPageNum(),goods.getPageSice());
        List<Goods> goodsLists= goodsMapper.goodslists(goods);
        PageInfo<Goods> goodsPageInfos = new PageInfo<>(goodsLists);
        return goodsPageInfos;
    }
}
